 C                                                                 SmartBASIC allows long variable names, but ONLY looks at the first two characters to decide what variable it is (not counting subscripts). So, NU is equivalent \r~05,80\\ 
\P\Q\CPAGE 15.\\ 
\r~05,40\\ 
\K\Q\AGENERAL PROGRAMMING TIPS CONT.,\\ 
\\ 
\\ 
SmartBASIC allows long variable names, but ONLY looks at the first two characters to decide what variable it is (not counting subscripts). So, NU is equivalent to NUMERATOR and/or NUMBER for SmartBASIC purposes. Watch out for this but make your variable names readable (plain english variable names are easier to remember & use, especially if you are working on a program longer than one screen).\\ 
\\ 
Our (Peter's) little program might come out looking like this.  \\ 
00 REM THIS PROGRAM TAKES TWO NUMBERS AND DIVIDES THE FIRST BY THE SECOND\\ 
10 REM START\\ 
20 INPUT "Numerator?  "; NUMERATOR\\ 
30 INPUT "Denominator? "; DENOMINATOR\\ 
40 IF DENOMINATOR = 0 THEN PRINT "ILLEGAL DENOMINATOR": GOTO 10: REM START.\\ 
50 RESULT = NUMERATOR/ DENOMINATOR\\ 
60 PRINT NUMERATOR; " ? "; DENOMINATOR; " = "; RESULT\\ 
99 END.\\ 
\\ 
While this example may seem trivial, it is the first embrionic skeleton of a full blown calculator, or even a spread sheet program.  You have to start somewhere, and you have to plan ahead. This is also a good simple example for beginners which will show them the steps necessary to go from an idea to a program to carry out that idea.\\ 
\\ 
Peter Hartzler continues, indicating that it is a good idea to embed little messages (or REM statements) in your program telling yourself what you are doing at a particular point in the program. This is a great help when you later go back to a program and try to figure out why you wrote it that why or how it actually works.  Also if you are writing this for someone else it will allow them to follow your thought process and will make it easier for them to modify or customize for their own purposes.\\ 
\\ 
The whole purpose of computer languages (such as Basic) is to make it possible for humans to read the instructions in something approaching English.  To this end it is worthwhile to use self explanitory variable names, include comments to explain what you're doing, and use subroutines to centralize specific operations.\\ 
\\ 
Besides summarizing and modifying the above article of Peter Hartzler slightly, I have added the following explanation:\\ 
\\ 
LINE EXPLANATIONS.\\ 
00 REM is a REM(ark) or note to yourself & does not have any actual effect on the program.\\ 
\\ 
10 Also a REM statement\\ 
\\ 
\\ 
\r~45,80\\ 
\K\Q\A\\ 
\\ 
\\ 
\\ 
\\ 
20 INPUT means ADAM is waiting for you to input or type in some information.  The word(s) in the "s after Input are printed to the screen so you have an idea what ADAM is asking you to input, in this case Numerator. The ; NUMERATOR means that from now on whatever value was input will be called NUMERATOR for the purposes of this program and whever the program asks for NUMERATOR, the actual value previously typed in by you as an input will be used.\\ 
\\ 
30 (Same as 20 but for Denominator).\\ 
\\ 
40 The IF means exactly that IF the following is true, then do what is indicated.  IF the following was not true, then this line would not be used in the program but skipped over. This line only comes into use IF the condition specified is true.\\ 
Here IF the (value input for ) if the denominator is 0, then the program prints to the screen "ILLEGAL DENOMINATOR". \\ 
\\ 
Next this line 40 has GOTO 10, this sends the program back to line l0 and it reruns from that point. The REM start, is merely to tell us why it is going back to line l0 or what line l0 actually did.\\ 
\\ 
50 We are creating another variable which is called RESULT and we are setting result equal to NUMERATOR/DENOMINATOR (numerator divided by denominator).\\ 
\\ 
60 Prints to the screen the value for NUMERATOR which we previously input , then what is in the "s (which is /), then the value we previously input for DENOMINATOR, then what is in the next set of "s (which is =) and finally the value which ADAM calculated in line 50 for Result.\\ 
\\ 
99 END, ends the program at this point.\\ 
\\ 
This program could be modified so that lines after line 60 and before line 99 asked if we wished to calculate another division and then if the answer was Yes, send the program back to line l0 and if the answer is other than yes, allow the program to go to line 99 and end.\\ 
\\ 
Such lines could be as follows:\\ 
\\ 
70 INPUT "DO YOU WANT TO CONTINUE?  Y OR N "; answer$\\ 
\\ 
(Line 70 has ADAM ask you if you want to continue and then wait for your answer.  Your answer will now become the variable answer$.  The $ is necessary as we are dealing with words or letters and not numbers at this point)\\ 
\\ 
80 IF answer$ = "Y" or if answer$ = "y" THEN GOTO 10.\\ 
\\ 
Barry A. Wilson.\\ 
\\ 
reen the value for NUMERATOR which we previously input , then what is in
